<template>
  <div>
    过滤器

    <ul>
        <li v-for="(item, index) in list" :key="index">
            {{ item.name }} --- {{ item.sex | filterSex }}
        </li>
    </ul>
  </div>
</template>

<script>
export default {
    name: "filters-com",
    data() {
        return {
            list: [
                {
                    name: "张三",
                    sex: 0
                },
                {
                    name: "李四",
                    sex: 1
                },
            ]
        }
    },
    filters: {
        filterSex(sex) {
            return sex === 0? '男': '女'
        }
    }
}
</script>

<style>

</style>